home *** CD-ROM | disk | FTP | other *** search
- // Project : NWFINF
- // Description : Application to show functions for getting Netware file info
- // Module : NWFINF.H
- // Version : 1.00 - 11/05/1994
- // Written by : David A. Mair
- // Copyright : Who cares, help yourself.
-
-
- #if !defined(__NWFINF_H)
- #define __NWFINF_H
-
-
- #include <fcntl.h>
- #include <io.h>
- #include <iostream.h>
- #include <sys\stat.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-
-
- // New types
- typedef int BOOL;
- typedef unsigned char BYTE;
- typedef unsigned short WORD;
- typedef unsigned long DWORD;
-
-
- struct nwDate
- {
- // The order of these is compiler implementation dependent
- WORD dtDay : 5;
- WORD dtMonth : 4;
- WORD dtYear : 7;
- };
-
-
- struct nwDateTime
- {
- // The order of these is compiler implementation dependent
- WORD tiSecond : 5;
- WORD tiMinute : 6;
- WORD tiHour : 5;
- WORD dtDay : 5;
- WORD dtMonth : 4;
- WORD dtYear : 7;
- };
-
-
- // Note the byte order information for the non-byte sized fields in the
- // following structures. In order to set a given field you must store the
- // value supplied by the compiler and use one of the SwapWord or SwapDWord
- // functions after storing the value. To use a value in a field you must
- // call the appropriate Swap... function before use.
-
- struct TFileInformation
- {
- WORD wBuffLen; // Lo-Hi
- WORD wSequence; // Hi-Lo
- char sFileName[14];
- BYTE faReadOnly : 1;
- BYTE faHidden : 1;
- BYTE faSystem : 1;
- BYTE faExecOnly : 1;
- BYTE faSubDir : 1;
- BYTE faArchive : 1;
- BYTE faSharable : 1;
- BYTE : 1;
- BYTE byExtendedAttr;
- DWORD dwFileSize; // Hi-Lo
- nwDate dtCreated; // Hi-Lo
- nwDate dtLastAccessed; // Hi-Lo
- nwDateTime dttLastUpdated; // Hi-Lo
- DWORD dwOwner; // Hi-Lo
- nwDateTime dttLastArchived; // Hi-Lo
- BYTE byReserved[56];
- };
-
-
- struct TFileInfoRequest
- {
- WORD wBuffLen; // Lo-Hi
- BYTE byMagicNumber;
- WORD wSequence; // Hi-Lo
- BYTE byDirHandle;
- BYTE :1;
- BYTE saHiddenFiles : 1;
- BYTE saSystemFiles : 1;
- BYTE : 5;
- BYTE byFileNameLength;
- char sFileName[256];
- };
-
-
- struct TBinderyObjectInfo
- {
- WORD wBuffLen; // Lo-Hi
- DWORD dwID; // Hi-Lo
- WORD wType; // Hi-Lo
- char sName[48];
- };
-
-
- struct TBinderyObjectInfoRequest
- {
- WORD wBuffLen; // Lo-Hi
- BYTE byMagicNumber;
- DWORD dwLastID; // Hi-Lo
- };
-
-
- // Function prototypes
- void AboutApp(void);
- void DisplayFileInfo(char *pszFileName);
- BYTE GetFileInformation(char *pszFileName, struct TFileInformation far *tFileInfo);
- BOOL IsFile(char *pszFileName);
- int main(int argc, char *argv[]);
- BYTE GetBinderyObjectName(DWORD dwBinderyObjectID, TBinderyObjectInfo far *tBinderyObjectInfo);
- void ShowSyntax(void);
- void SwapDWord(DWORD far *dwToSwap);
- void SwapWord(WORD far *wToSwap);
-
-
- // Manifest constants
- #define FALSE 0
- #define TRUE 1
-
-
- #endif
-